/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @file  Can_Cfg.h
 * @brief Semidrive. AUTOSAR 4.3.1 MCAL Can Driver.
 * @date 2025-03-25 19:03:22
 */

#ifndef CAN_CFG_H_
#define CAN_CFG_H_

#ifdef __cplusplus
extern "C"{
#endif

/* Version and Check Begin */
/* Version Info Begin */
#define CAN_CFG_H_VENDOR_ID    0x8C
#define CAN_CFG_H_AR_RELEASE_MAJOR_VERSION    4
#define CAN_CFG_H_AR_RELEASE_MINOR_VERSION    3
#define CAN_CFG_H_AR_RELEASE_REVISION_VERSION 1
#define CAN_CFG_H_SW_MAJOR_VERSION    1
#define CAN_CFG_H_SW_MINOR_VERSION    0
#define CAN_CFG_H_SW_PATCH_VERSION    0
/* Version Info End */
/* Version and Check End */


/**
 * @brief Specify whether pre-compile is supported.
 */
 #define CAN_PRECOMPILE_SUPPORT     (STD_OFF)

/**
 * @brief specific the AUTOSAR CAN driver version
 *
 */
#define AUTOSAR_VERSION_431 1u

/**
 * @brief Switches the development error detection and notification on or off.
 */
#define CAN_DEV_ERROR_DETECT     (STD_ON)

/**
 * @brief Instance number of the driver, used by Det_ReportError.
 */
#define CAN_INSTANCE (0U)

/**
 * @brief Period for cyclic call to Can_MainFunction_Mode. Unit is millisecond.
 */
#define CAN_MAIN_FUNCTION_MODE_PERIOD (10U)

/**
 * @brief Specifies if multiplexed transmission shall be supported.
 */
#define CAN_MULTIPLEXED_TRANSMISSION     (STD_ON)

/**
 * @brief Specify the maximum time for blocking function until a timeout is detected.
 * Unit is microsecond.
 */
#define CAN_TIMEOUT_DURATION (1000000U)

/**
 * @brief low power/freeze mode regiter operator counter.
 */
#define FLEXCAN_TIMEOUT_CNT (1000000U)

/**
 * @brief Switches the Can_GetVersionInfo() API ON or OFF.
 */
#define CAN_VERSION_INFO_API     (STD_OFF)

/**
 * @brief The period of cyclic call to Can_MainFunction_Busoff.
 * Unit is milliseconds.
 */

/**
 * @brief The period of cyclic call to Can_MainFunction_Wakeup.
 * Unit is milliseconds.
 */

/**
 * @brief Support of Can_SetBaudrate API.
 */
#define CAN_SET_BAUDRATE_API (STD_OFF)
/**
 * @brief Specify whether multiple read period is supported or not.
 */
#define CAN_MULTIPLE_READ_PERIOD (STD_OFF)

/**
 * @brief Specify whether multiple write period is supported or not.
 */
#define CAN_MULTIPLE_WRITE_PERIOD (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 0 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_0 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 1 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_1 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 2 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_2 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 3 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_3 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 4 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_4 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 5 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_5 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 6 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_6 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 7 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_7 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 8 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_8 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 9 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_9 (STD_OFF)

/**
 * @brief Support of Can_CheckWakeup API.
 */
#define CAN_CHECK_WAKEUP_API (STD_OFF)

/**
 * @brief Support of trigger-transmit.
 */
#define CAN_TRIGGER_TRANSMIT_EN (STD_OFF)

/**
 * @brief The number of CAN controller configured.
 */
#define CAN_CONTROLLER_COUNT (2U)

/**
 * @brief The number of VCAN controller configured.
 */
#define VCAN_CONTROLLER_COUNT (1U)

/**
 * @brief The number of VCAN controller configured.
 */
#define CAN_VCAN_TOTAL_CONTROLLER_COUNT (3U)

/**
 * @brief Specify whether used vcan.
 */
#define VCAN_ENABLE     (STD_ON)

/**
 * @brief Specify whether CAN driver should support CAN FD.
 */
#define CAN_FD_SUPPORT  (STD_OFF)

/**
 * @brief Specify whether CAN driver should support Enhanced FIFO.
 */

#define CAN_ENHANCED_FIFO_SUPPORT   (STD_ON)

/** \brief  Total Number of Core  Supported */
#define CAN_CFG_CORE_NUM_MAX   (4U)


/**
 *  \name PWM controller(s) assigned core
 *  \{
 */
/** \brief  Whether PWM controller(s) is assigned to core0  */
#define CAN_CFG_ENABLE_CORE0            (STD_ON)
/** \brief  Whether PWM controller(s) is assigned to core1  */
#define CAN_CFG_ENABLE_CORE1            (STD_OFF)
/** \brief  Whether PWM controller(s) is assigned to core2  */
#define CAN_CFG_ENABLE_CORE2            (STD_OFF)
/** \brief  Whether PWM controller(s) is assigned to core3  */
#define CAN_CFG_ENABLE_CORE3            (STD_OFF)
/** \} */

/**
 * @brief The definition of HOHs.
 */
#define CAN_HRH_0 0U
#define CAN_HTH_1 1U
#define CanHardwareObject_0 2U
#define CanHardwareObject_1 3U

#define CAN_HOH_MAX 4U

/**
 * @brief The first HTH configuration index.
 */
#define FIRST_HTH_INDEX (3U)

/**
 * @brief The number of all Rx and Tx MBs.
 */
#define CAN_MB_COUNT (2U)

/**
 * @brief The number of VCAN Rx and Tx MBs.
 */
#define VCAN_MB_COUNT (1U)

/**
 * @brief The number of CAN and VCAN Rx and Tx MBs.
 */
#define CAN_VCAN_TOTAL_MB_COUNT (3U)

/**
 * @brief The number of all Rx FIFOs.
 */
#define CAN_RX_FIFO_COUNT (1U)

/**
 * @brief Specify whether CAN driver should support Legacy FIFO.
 */
#define CAN_RXFIFO_SUPPORT  (STD_OFF)

/**
 * @brief Specify Can Controller index.
 */
#define CanConf_CanController_CANFD3 0U
#define CanConf_CanController_CANFD5 1U




#ifdef __cplusplus
}
#endif

#endif /* CAN_CFG_H_ */
